﻿using System;
using System.Text;

namespace FranceTriple.Dal
{
    public static class ExceptionExtensions
    {
        public static string ToDetailedString(this Exception ex)
        {
            StringBuilder exceptionString = new StringBuilder();

            exceptionString.AppendLine(ex.Message);
            exceptionString.AppendLine("Source : " + ex.Source);
            exceptionString.AppendLine("TargetSite : " + ex.TargetSite.ToString());
            exceptionString.AppendLine("StackTrace : " + ex.StackTrace);
            exceptionString.AppendLine("HelpLink : " + ex.HelpLink);

            return exceptionString.ToString();
        }
    }
}
